# encoding = utf-8
module CartsHelper
  def amount(carts)
    amo = 0
    carts.each do |cart|
      product = cart.product
      amo+=(product.price*cart.number*product.discount/10)
    end
    return amo
  end
end
